<script setup>
import PlanChart from './PlanChart.vue';

// 定义props - 修改为支持双产线卡片
const props = defineProps({
  line1: {
    type: Object,
    required: true
  },
  line2: {
    type: Object,
    required: true
  }
});
</script>

<template>
  <div class="production-card">
    <div class="dual-line-container">
      <!-- 左侧产线 -->
      <div class="line-section">
        <h3 class="line-title">{{ line1.lineName }}</h3>
        <PlanChart 
          title="周计划 Weekly plan" 
          :dataItems="line1.weeklyPlan.dataItems" 
          :completionRate="line1.weeklyPlan.completionRate" 
        />
      </div>
      
      <!-- 右侧产线 -->
      <div class="line-section">
        <h3 class="line-title">{{ line2.lineName }}</h3>
        <PlanChart 
          title="周计划 Weekly plan" 
          :dataItems="line2.weeklyPlan.dataItems" 
          :completionRate="line2.weeklyPlan.completionRate" 
        />
      </div>
    </div>
  </div>
</template>

<style scoped>
.production-card {
  margin-bottom: 10px;
  width: 100%;
  border: 2px solid #5e5e5e;
  border-radius: 8px;
  padding: 5px;
  box-shadow: 0 0 10px rgba(147, 147, 147, 0.3);
  transition: all 0.3s ease; 
}

.dual-line-container {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.line-section {
  flex: 1;
  min-width: 0;
}

.line-title {
  font-size: 26px;
  text-align: center;
  margin: 0 0 15px 0;
  color: #333;
}

@media (max-width: 950px) {
  .dual-line-container {
    flex-direction: column;
  }
  
  .line-section {
    width: 100%;
  }
  
  .line-title {
    font-size: 20px;
  }
}
</style>